package www.bit.demo2;

import java.sql.SQLOutput;

abstract class Animals {
    public String name;

    public Animals(String name) {
        this.name = name;
    }
    public void eat() {
        System.out.println("chi");
    }

}
class Dog extends Animals implements IRun,ISwinming {

    public Dog(String name) {
        super(name);
    }
    @Override
    public void run() {
        System.out.println(this.name + "正在用四条腿跑");
    }

    @Override
    public void swim() {
        System.out.println(this.name + "正在狗刨");
    }
    public void eat() {
        System.out.println(this.name + "正在吃狗量");
    }
}
class Bird extends Animals implements IFly,IRun {

    public  Bird(String name) {
        super(name);
    }
    @Override
    public void fly() {
        System.out.println(this.name + "正在用俩个翅膀飞");
    }
    @Override
    public void run() {
        System.out.println(this.name + "俩条腿跑");
    }
    public void eat() {
        System.out.println(this.name + "正在吃尿量");
    }
}
public class Test {
    public static void eat(Animals animals) {
       animals.eat();
    }
    public static void testfly(IFly iFly) {
        iFly.fly();
    }
    public static void main(String[] args) {
       /* eat(new Dog("旺财"));
        eat(new Bird("buge"));*/
        testfly(new Bird("小白"));

    }

}
